from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from PIL import Image
import time
driver = webdriver.Edge()
driver.get('http://10.59.9.14:7003/')
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
driver.find_element(By.CLASS_NAME,'regi-input').send_keys('15232008902')
driver.find_element(By.NAME,'password').send_keys('123456')
time.sleep(2)
driver.save_screenshot('a3mall.png')
dingwei = driver.find_element(By.XPATH,'/html/body/div[4]/div/div[1]/div[2]/form/div[3]/span[3]/img')
location = dingwei.location
size = dingwei.size
print(location)
print(size)
left = location['x']
shang=location['y']
right = left+size['width']
xia = shang+size['height']
Image = Image.open('a3mall.png')
Image1 = Image.crop((left*1.5,shang*1.5,right*1.5,xia*1.5))
Image1.save('a3mall1.png')


